package com.holly.common.utils;

import android.content.Context;
import android.net.ConnectivityManager;

/**
 * 判断网络情况
 */
public class NetUtils {
    public static boolean hasInternet(Context context) {
        boolean flag = false;
        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        flag = manager.getActiveNetworkInfo() != null;
        return flag;
    }

}
